Title: Natural Ability Extension
Author: GrayShadows (in.the.afterlight@gmail.com)
Version: v1.1
Applies to: FF6us v1.0, FF6us v1.1
Tested on: FF6us v1.0

Contents: NatAbi - H.ips (For a headered ROM)
	  NatAbi - NH.ips (For an unheadered ROM)
          AntiNatAbi - H.ips (For a headered ROM)
	  AntiNatAbi - NH.ips (For an unheadered ROM)
	  NatAbi.asm
          readme.txt

ROM addresses:
C0/9F6D - C0/9F6F [In-line]
C0/A177 - C0/A179 [In-line]
C0/BE2F - C0/BE34 [In-line]
C0/C547 - C0/C549 [In-line]
C0/D68D - C0/D75B [Free space]
C2/60BC - C2/60BE [In-line]
C2/A736 - C2/A7BB [Free space]
EC/E3A0 - EC/E3BF [Free space]
EC/E3F0 - EC/E3F3 [Free space]

Frees:
C0/A17F - C0/A227
C2/61B6 - C2/6234

Urgency: Minimal. This patch fixes a minor issue with Celes' 
natural magic skillset, but otherwise is a tweak to add flavour 
rather than functionality.

-----------------------------------------------------------------
Description:

Natural Ability Extension... extends the natural ability set. 
Odd, I know! Its primary function is to give Relm her own natural
magic list that she will learn at recruitment/on level up. It 
also gives Mog Wind Song at recruitment. 

Additionally, it fixes a minor issue with Celes' natural magic
list that is only a problem in vanilla if she surpasses level 32
due to level averaging.

The assembly is included (NatAbi.asm); a good deal of the 
comments come directly from the C0 and C2 disassemblies found
at Slick Productions, and another chunk are derived/reworded
from same. I haven't tested the patch on a 1.1 rom, but I 
don't believe I overwrite anything in it that's different from
the 1.0. YMMV; let me know if you run into any problems. Relm's
spell list should be easy to modify if you'd like to teach her 
different spells/at different levels.

The subroutines at C2/61B6 and C0/A17F haven't actually been
deleted/changed, but they're no longer necessary -- they've
been completely duplicated at the new locations -- so if you
want to incorporate this patch into something else, the 
listed ranges can be considered free space.

The addresses used have been checked against Imzogelmo's 
Patch Allocation list, but given that it's two and a half years
old, I don't know if I've used space claimed by any new patches.

-----------------------------------------------------------------
What this patch does:

Natural Ability Extension adds Relm to the list of characters
who learn magic spells via level up; to do this, the subroutines
governing the learning of natural abilities (magic for Terra and
Celes, as well as both Blitzes and SwdTechs) had to be moved to 
free space to allow them to be extended.

Relm's magic list was added in the free space immediately 
preceding the existing table. Her spells are as follows:

Cure @ 1            Demi @ 35
Antdot @ 3          Bolt 3 @ 40
Bolt @ 8            Cure 2 @ 46
Slow @ 12           Slow 2 @ 52
Life @ 18           Pearl @ 60
Bolt 2 @ 22         Cure 3 @ 73
Osmose @ 26         Quake @ 82
Bio @ 32            Quick @ 97

I attempted to balance out Relm's learning to make it roughly
equal to both Celes and Terra's lists, while making her 
different enough to be useful in a NM game. (She learns Cure 3 
where neither Celes or Terra do, has Life but not Life 2, and
learns Quake has her strongest attack spell and Quick as her
'ultimate' spell, compared to Ultima for Terra and Meteor for
Celes.) As both Celes and Terra learn Pearl, I included it for 
Relm as well.

Dances were added to the list of abilities that are initialised
in RAM with a new game, in the same way as Lores and Rages.
To do this, I overwrote a small function at C0/BE2F that sets
the font colour to white; as this (as noted in the disasm doc)
is also accomplished in C3, overwriting it here appears to cause
no problems. If anyone runs into anything, though, let me know.

As for Celes, in vanilla, her natural magic has a minor glitch:
because Berserk (learned at a higher level) sits between Haste
and Muddle (both learned at level 32), if Celes goes above level
32 due to averaging, she won't learn Muddle. This patch resolves 
this by switching Muddle and Berserk in the table; it also adds 
a level to Muddle, teaching it instead at level 33.
 

-----------------------------------------------------------------
Updates:

v1.0 - July 2, 2013

v1.1 - July 3, 2013
       * The code is rendered more efficient by changing the way
         in which the default Dances are learned. This frees up 
         46 bytes of space that were used by the initial patch.
       * The .asm document is much more thoroughly commented,
         partly to offer a more detailed look at what's happening
         and what I've changed.


-----------------------------------------------------------------
Credits:

C2 Bank Disassembly: Terii Senshi & assassin
C0 Bank Disassembly: Imzogelmo, assassin, Lenophis and Novalia 
                     Spirit

Lord Sutubenu, Edrin, and the members of ff6hacking.com, for this 
thread: http://www.ff6hacking.com/forums/showthread.php?tid=729, 
which was invaluable to this hack.

Readme Format: Lenophis, by way of Ronnen